package cn.ante.ymcc.web.controller;

import cn.ante.ymcc.dto.AlipayNotifyDto;
import cn.ante.ymcc.service.IPayNotifyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/pay")
public class PayNotifyController {

   @Autowired
   private IPayNotifyService payNotifyService;

    @RequestMapping(value = "/alipay/notify",method = RequestMethod.POST)
    public String getNotify(AlipayNotifyDto dto){
        try {
            return payNotifyService.getNotify(dto);
        } catch (Exception e) {
            e.printStackTrace();
            return "error";
        }
    }
}
